#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main()
{
    int n;
    cin >> n;
    cin.ignore();
    string s;
    getline(cin, s);
    int count[10] = { 0 };
    for (auto ch : s)
    {
        if (ch != ' ')
            count[ch - '0']++;
    }
    int ret = 0;
    for (int i = 0; i < 10; i++)
    {
        ret = max(ret, count[i]);
    }
    cout << ret << ":" << " ";
    vector<int> v;
    for (int i = 0; i < 10; i++)
    {
        if (count[i] == ret)
            v.push_back(i);
    }
    for (int i = 0; i < v.size(); i++)
    {
        cout << v[i];
        if (i != v.size() - 1)
            cout << " ";
    }
    return 0;
}